﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MQ4.aspx.cs" Inherits="ZX.WebApp.Message.MQ4" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>  
  <head  runat="server">  
  <title></title> 
  <link rel="stylesheet" type="text/css" href="../Scripts/yui_2.9.0/build/container/assets/skins/sam/container.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/layout/assets/skins/sam/layout.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/resize/assets/skins/sam/resize.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/datatable/assets/skins/sam/datatable.css" />
    <link href="../Styles/base.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.json-2.2.js" type="text/javascript"></script>
    <script src="../Scripts/Jquery.form.js" type="text/javascript"></script>
    <script src="../Scripts/CombinButton.js" type="text/javascript"></script>
    <link href="../Styles/default/calendar.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery.calendar.js" type="text/javascript"></script>
    <script src="../Scripts/extend.validate.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/paginator/paginator-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/event-delegate/event-delegate-min.js"></script>

    <link href="../Styles/extendTable.css" rel="stylesheet" type="text/css" />
    <link href="cssjs/message.css" rel="stylesheet" type="text/css" />
     <style type="text/css">
         .tabck
         {
              width:100%;
         }
        .tableContent
        {
            font-size:12px;
        }
        .tableContent th
        {
            border: solid 1px #D4DBE2;
            font-weight: bold;
            background-color: #F2F8FF;
            white-space: nowrap;
            line-height: 28px;
            text-align: left; padding-left:3px;
        }
        .tableContent td
        {
            border: solid 1px #D4DBE2;
            background-color: #F2F8FF;
            line-height: 28px;
            text-align: left;
            padding-left:3px;
        }
        .textbox
        {
            border-bottom: black 1px solid;
            border-top-style: none;
            border-right-style: none;
            border-left-style: none;
            background-color: white;
            overflow:hidden;
            height: 100%;
            width:98%; 
        }
         .style6
        {
           border-bottom: black 1px solid;
           border-top-style: none;
           border-right-style: none;
           border-left-style: none;
           background-color: white;
           overflow:hidden;
           height: 100%;
           width: 98%;
        }
        .labmessage
        {
            margin-left:102px;
            color:Red; 
        }
    </style>
</head>
<body  class="yui-skin-sam">
    <form id="form1" class="formBuilderForm" runat="server">
  
    <table class="tableContent">
    <tr>
             <td colspan="6">
             <button type="button" tabindex="0" onclick="fnCusAdd();"  style="width: 80px;height:25px;" id="btnAdd-button">新增</button>
             <button type="button" tabindex="2" onclick="fnCusSele();" style="width: 80px;height:25px;" id="btnsele-button">查询</button>
             <button type="button" tabindex="2" onclick="confirmdelete1();" style="width: 80px;height:25px;" id="Button1">删除</button>
            </td>
    </tr>
            <tr>
            <td >客户名称
            </td>
               <td ><input type="text" id="Tcomename" name="receave"  runat="server"  style="width:150px;" />
            </td>
            <td >企业名称
            </td>
            <td ><input type="text" id="Tcompany" name="receave"  runat="server"  style="width:150px;" />
            </td>
            <td >来电号码
            </td>
            <td ><input type="text" id="Tcphone" name="receave"  runat="server"  style="width:150px;" />
            </td> 
            </tr>
            <tr>
            <td>记录分类
            </td>
               <td ><asp:DropDownList ID="selecttype" runat="server" AppendDataBoundItems="true" Width="150">
                        <asp:ListItem Value="1">新客户咨询</asp:ListItem>
                        <asp:ListItem Value="2">老客户咨询</asp:ListItem>
                        <asp:ListItem Value="3">成交客户</asp:ListItem>
                        <asp:ListItem Value="4">投诉电话</asp:ListItem>
                        <asp:ListItem Value="5">应聘咨询</asp:ListItem>
                        <asp:ListItem Value="6">订购书籍</asp:ListItem>
                        <asp:ListItem Value="7">招商咨询</asp:ListItem>
                        <asp:ListItem Value="8">签鹰客户</asp:ListItem>
                        <asp:ListItem Value="9">找行销顾问</asp:ListItem>
                        <asp:ListItem Value="10">内部电话</asp:ListItem>
                        <asp:ListItem Value="11">讲师分区</asp:ListItem>
                        <asp:ListItem Value="12">讲场未成交</asp:ListItem>
                    </asp:DropDownList><span style="color: Red">*</span>
            </td>
            <td >接电人
            </td>
            <td ><input type="text" id="Trecname" name="receave"  runat="server"  style="width:150px;" />
            </td>
            <td >处理人
            </td>
            <td ><input type="text" id="Tprocname" name="receave"  runat="server"  style="width:150px;" />
            </td> 
            </tr>
            <tr>
            <td colspan="6"><%--Extend/YUIList.aspx?entity=V_MQ400Main&order=Addtime--%>
             <iframe id="dataview" name="frame1" frameborder="0" src="../Extend/YUIList.aspx?entity=V_MQ400Main&editentity=MQ400Main&order=comeintime desc" style="width: 100%; height: 500px;
                margin: 0px; padding: 0px;"></iframe>
            </td>
            </tr>
            </table>
   <div id="dialog1" class="yui-pe-content">


            <div class="hd">
                人员选择</div>
            <div class="bd">
                <iframe id="EditUIWindow1" frameborder="0" src="" style="width: 100%; height: 100%;
                    margin: 0px; padding: 0px;"></iframe>
            </div>
        </div>
    </form>
</body>
<script language="javascript" type="text/javascript" src="../Scripts/DatePicker/WdatePicker.js"></script>
<script  language="javascript" type="text/javascript">
    //自定义增加方法
    var fnCusAdd = function () {

        parent.addTabs("添加400电话记录", '../message/Mq400.aspx?entity=MQ400Main');
        parent.NeedRefreshPage = this;
    }

    var confirmdelete1 = function () {
            var ifr = document.getElementById("dataview").contentWindow;
            //ifr.document.getElementById("btnDelete-button").onclick();
            //obtb.click();
            //window.frames["dataview"].DeleteData();
            //dataview.window.fnCustomDeleteData();
            ifr.fnDelete();
    }
    //自动义查询事件
    var fnCusSele = function () {
        var comename = document.getElementById("Tcomename");
        var company = document.getElementById("Tcompany");
        var cphone = document.getElementById("Tcphone");
        var selecttype = document.getElementById("selecttype");
        var recname = document.getElementById("Trecname");
        var procname = document.getElementById("Tprocname");
        var cond = "1=1";
        if (comename.value != "") {
            cond += " and comename like '%" + comename.value + "%'";
        }
        if (company.value != "") {
            cond += " and company like '%" + company.value + "%'";
        }
        if (cphone.value != "") {
            cond += " and cphone like '%" + cphone.value + "%'";
        }
        if (selecttype.value != "") {
            cond += " and typeid='" + selecttype.value + "'";
        }
        if (recname.value != "") {
            cond += " and recname like '%" + recname.value + "%'";
        }
        if (procname.value != "") {
            cond += " and procname like '%" + procname.value + "%'";
        }
        var condition = encodeURI(cond);
        var scr = "../Extend/YUIList.aspx?entity=V_MQ400Main&editentity=MQ400Main&order=Addtime&functionID=a612f805-8a8b-4285-832e-db7a2dba5aa4&condition=" + condition;
        document.getElementById("dataview").src = scr;

    }
    function RefreshData()//刷新父页数据
    {
        if (parent.NeedRefreshPage != null) {
            if (typeof (parent.NeedRefreshPage.LoadData) == "function") {
                parent.NeedRefreshPage.RefreshData();
            }
        }
    }
    
    //只取一个URL参数：
    var queryString = function (key) {
        return (document.location.search.match(new RegExp("(?:^\\?|&)" + key + "=(.*?)(?=&|$)")) || ['', null])[1];
    }
  
    //选择对应的方法和ID
    var _fn, _id;
    function ShowDialog1(fn, id, src) {
        _fn = fn;
        _id = id;
        document.getElementById("EditUIWindow1").src = src;
        YAHOO.example.container.dialog1.show();
    }
    YAHOO.namespace("example.container");
    YAHOO.util.Event.onDOMReady(function () {
        var handleSubmit = function () {
            var editwindow = document.getElementById("EditUIWindow1");
            if (editwindow) {
                editwindow.contentWindow.ChooseInfo();
            }
            YAHOO.example.container.dialog1.hide();
        };
        var handleCancel = function () {
            this.cancel();
        };
        var handleSuccess = function (o) {
            var response = o.responseText;
            response = response.split("<!")[0];
            document.getElementById("resp").innerHTML = response;
        };
        var handleFailure = function (o) {
            alert("Submission failed: " + o.status);
        };
        YAHOO.example.container.dialog1 = new YAHOO.widget.Dialog("dialog1",
					            { width: "580px",
					                height: "450px",
					                fixedcenter: true,
					                visible: false,
					                draggable: true,
					                close: true,
					                autofillheight: "body",
					                constraintoviewport: true,
					                buttons: [{ text: "确定", handler: handleSubmit, isDefault: true },
								            { text: "取消", handler: handleCancel}]
					            });
        YAHOO.example.container.dialog1.callback = { success: handleSuccess, failure: handleFailure };
        YAHOO.example.container.dialog1.render();
    });
</script>
  </html>
